# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd

if __name__ == '__main__':
    path = r'../附件/中间数据/时间-风险.xlsx'
    data = pd.read_excel(path, index_col=0, header=0)
    
    score = list(data.sum(axis=0).values)
    time_23_30 = (140.87487118928732 + 140.51674777337848 )/2
    time_24_00 = (140.48243399368258 + 140.52817104974736 )/2
    score += [time_23_30, time_24_00]
    max_score = max(score)
    score = 100*(1 - score/max_score)
    
    max_score = max(score)
    score /= max_score
    score *= 100
    time = pd.timedelta_range(start='0.5 hour', periods=48, freq='0.5H')
    
    for i in range(48):
        print('时间： ', time[i])
        print('安全得分: ', score[i])
